/**
 * 
 */
package model.facade.persistence.mysql;

import java.sql.Connection;
import java.sql.SQLException;

import model.facade.persistence.AbstractDomainDAO;

/**
 * @author Giuseppe Fusco (fusgius19@gmail.com)
 *
 */
public abstract class MySQLDomainDAO extends AbstractDomainDAO {

	/**
	 * @param dbms
	 * @throws SQLException 
	 */
	public MySQLDomainDAO(MySQLDBMS dbms) throws SQLException {
		super(dbms);
		if(dbms!=null){
				Object o = dbms.getConnection();
				if(o!=null)
					{
					this.mys = dbms;
					((Connection)mys.getConnection()).setAutoCommit(false);
					}
				else
					throw new IllegalStateException("Nessuna connessione presente.");
		}
		else
			throw new IllegalStateException("Nessun dbms attivo.");
	}

	protected MySQLDBMS mys;
	
}
